import api from "./api";
import { MyHttps } from "../utils/utils";

export async function UserLoginReq(params) {
    return MyHttps.post(api.user.login(),params)
}

export async function UserLogoutReq(){
    return MyHttps.post(api.user.logout())
}

export async function UserRegisterReq(params){
    return MyHttps.post(api.user.register(),params)
}

export async function UserUploadAvatarReq(params){
    return MyHttps.uploadFile(api.user.uploadAvatar(),params.filePath)
}

export async function UserUpdateMyInfoReq(params:{field:string,value:string}){
    return MyHttps.post(api.user.updMyInfo(params.field),params)
}

export async function UserCheckLoginReq(params) {
    return MyHttps.get(api.user.checkLogin(),params)
}

export async function UserSearchReq(params) {
    return MyHttps.post(api.user.search(),params)
}